<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>文件上传</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
	</head>
	<body>
		<form method="POST" enctype="multipart/form-data" action="file_manage_control.php" name="form1">
			<input type="hidden" name="activepath" value="{dede:global name='activepath'/}">
			<input type="hidden" name="fmdo" value="upload">
			<table class="table shadow-sm my-3">
				<tr>
					<td colspan="2">文件上传</td>
				</tr>
				<tr>
					<td width="260">当前目录：</td>
					<td>{dede:global name='activepath'/}</td>
				</tr>
				<tr>
					<td>上传操作：</td>
					<td>
						<button type="button" class="btn btn-success btn-sm" name="bbb" onclick="make_upload();">添加上传框</button>
						<a href="file_manage_main.php?activepath={dede:global name='activepath'/}" class="btn btn-success btn-sm">返回目录</a>
					</td>
				</tr>
				<tr>
					<td colspan="2" id="upfield">
						<p><label>文件1：<input type="file" name="upfile1" class="admin-input-lg"></label></p>
					</td>
				</tr>
				<tr>
					<td  colspan="2" align="center">
						<button type="submit" class="btn btn-success btn-sm" name="B1">上传文件</button>
						<button type="button" class="btn btn-success btn-sm" name="B12" onclick="reset_upload();">重新上传</button>
					</td>
				</tr>
			</table>
		</form>
		<script>
			var i = 1;
			function make_upload() {
				i++;
				myob = document.getElementById("upfield");
				myob.innerHTML+="<p><label>文件"+i+"：<input type='file' name='upfile"+i+"' class='admin-input-lg'></label></p>";
			}
			function reset_upload() {
				myob = document.getElementById("upfield");
				myob.innerHTML="<p><label>文件1：<input type='file' name='upfile1' class='admin-input-lg'></label></p>";
			}
		</script>
	</body>
</html>